package Mash.Map;

import Mash.MapObjects.Unit.Unit;

import java.io.Serializable;
/*Copyright (c)  Sergey Schekochikhin (Genocidicbunny)
 * created on Oct 5, 2009 11:34:51 PM
 */

public class UnitMap implements Serializable{
	private Unit[][] uMap;
	public UnitMap(int row, int col){
		uMap = new Unit[row][col];
	}
	public boolean addUnit(int row, int col, Unit unit){
		if(uMap[row][col] != null)
			return false;
		else{
			uMap[row][col] = unit;
			return true;
		}
	}
	public boolean moveUnit(int irow, int icol, int frow, int fcol){
		if(uMap[frow][fcol] != null)
			return false;
		else{
			uMap[frow][fcol] = uMap[irow][icol];
			uMap[irow][icol] = null;
			return true;
		}
	}
}
